const isReservedTag = (tag) => {
  return ['a', 'div', 'p', 'span', 'ul', 'li'].includes(tag)
}

export function createElement (tag, data, ...children) {
  if (isReservedTag(tag)) {
    return vnode(tag, data, children, undefined, undefined)
  } else {
    // 创造一个组件的虚拟节点（包含组件的构造函数）
    
  }
  // return vnode(tag, data, children, undefined, undefined)
}

export function createTextVNode (text) {
  return vnode(undefined, undefined, undefined, text, undefined)
}

export function vnode (tag, data = {}, children, text, elm) {
  const key = data.key
  delete data.key

  return {
    tag, data, children, text, elm, key
  }
}

export function isSameVnode (vnode1, vnode2) {
  return vnode1.tag === vnode2.tag && vnode1.key === vnode2.key
}